<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../../static/plugins/bootstrap-3.4.1/css/bootstrap.css">
    <style>
        .container {
            text-align: center;
        }

        .container th {
            text-align: center;
        }
    </style>
</head>

<body>

    <script>
        // 1 输入 +prompt price num address total
        let price = +prompt("请输入商品价格：")
        let num = +prompt("请输入商品数量：")
        let address = prompt("请输入收货地址：")
        // 2 计算总和 total
        let total = (price * num)
        // 3 打印渲染
        document.write(`
            <div class="container">
            <h2>订单确认</h2>
            <table class="table table-bordered">
                <thead>
                    <tr>
                        <th>#</th>
                        <th>商品名称</th>
                        <th>商品价格</th>
                        <th>商品数量</th>
                        <th>总价</th>
                        <th>收货地址</th>

                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <th scope="row">1</th>
                        <td>小米手机青春plus</td>
                        <td>${price}元</td>
                        <td>${num}</td>
                        <td>${total}元</td>
                        <td>${address}</td>
                    </tr>

                </tbody>
            </table>
        </div>
        `)

    </script>
</body>

</html>